package cn.calm.xhtml.impl.ui;

import cn.calm.xhtml.annotation.Attribute;
import cn.calm.xhtml.annotation.Tag;
import cn.calm.xhtml.api.exception.XhtmlException;
import cn.calm.xhtml.api.service.AbstraceNodeProcess;
import cn.calm.xhtml.api.service.ResponseWriter;
import cn.calm.xhtml.api.service.XhtmlContext;
@Tag(namespace = "http://www.calm.cn/xhtml/extras/ui", attributes = {
		@Attribute(name = "value", description = "提交值", template = "<label></label><input name=\"value\"/>"),
		@Attribute(name = "name", description = "提交名称", template = "<label></label><input name=\"name\"/>") })
public abstract class InputNode extends AbstraceNodeProcess {
	public static final String KEYS_NAME = "name";
	public static final String KEYS_VALUE = "value";
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Override
	public void processNode(XhtmlContext context) throws XhtmlException {
		createTag(context);
	}

	public void createTag(XhtmlContext context) {
		ResponseWriter writer = context.getResponseWriter();
		writer.startTag(getTag());
		writeAttr(context, "name", KEYS_NAME);
	}

	public String getTag() {
		return "input";
	}
}
